#ifndef COMPONENT_H
#define COMPONENT_H
#include "StompedReality/Base.h"
#include "StompedReality/Core.h"
#include "StompedReality/Core/GameAccess.h"
#include "StompedReality/Core/GameTime.h"
#include "StompedReality/Core/MessageSystem/ProcessMessage.h"
namespace StompedReality
{
namespace Core
{

class ComponentConstuctionHelper;

/*!
 * \author	Stefan Kazalski
 *
 * \brief	Component base
 *
 *    All components should inhert this class.
 */
class DLL_EXPORT Component : public StompedReality::Core::MessageHandler,
  public StompedReality::GameAccess
{
 protected:

  ID m_Id;
  TYPE_ID m_Type;

 public:

  Component ( );
  virtual ~Component( );

  //! \brief	IsDrawable?
  //bool IsDrawable( );

  //! \brief	IsUpdateable?
  //bool IsUpdateable( );

  //! \brief	Return the id.
  //! \return	The id.
  const ID GetID ( );

  //! \brief	Sets the id.
  //! \param	id	the id.
  void SetID ( const ID id );

  const TYPE_ID GetType ( );
  void SetType ( const TYPE_ID type );

  //! \brief	Return the render order.
  //! \return	The order.
  const unsigned char GetRenderOrder( );

  //! \brief      Update.
  virtual void Update ( ) {
  };

  //! \brief	Draw function.
  //!   Sends the render information to the renderer.
  virtual void Draw( ) {
  };

  //! \brief	Exectuted after creation
  virtual void OnCreation( );

  //! \brief	Exectuted afte values read by TypeSystem.
  //!			Initialzies the component.
  //! \param	constructionHelper The contruction helper.
  virtual void InitializeComponent( StompedReality::Core::ComponentConstuctionHelper* constructionHelper ) {
  };

  //! \brief	Exectuted before destruction
  virtual void OnDestruction( ) {
  };

  //! \brief	Processes a message.
  //! \param	msg The message.
  virtual bool ProcessMessage ( StompedReality::Core::Message* msg );
};

}
}
#endif // COMPONENT_H
